<template>
  <el-container direction="vertical">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>系统管理</el-breadcrumb-item>
      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-row :gutter="10" type="flex">
      <el-col :span="6">
        <el-tree default-expand-all :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
      </el-col>
      <el-col :span="18">
        <el-header>
          <el-form :inline="true" label-width="100px">
            <el-form-item label="用户名称" size="mini">
              <el-input placeholder="用户名称"></el-input>
            </el-form-item>
            <el-form-item label="手机号码" size="mini">
              <el-input placeholder="手机号码"></el-input>
            </el-form-item>
            <el-form-item label="状态" size="mini">
              <el-select placeholder="状态" value="全部">
                <el-option value="全部" />
                <el-option value="正常" />
                <el-option value="禁用" />
              </el-select>
            </el-form-item>
            <el-form-item label="创建时间" size="mini">
              <el-input placeholder="创建时间"></el-input>
            </el-form-item>
            <el-form-item size="mini">
              <el-button icon="el-icon-search" type="primary">查询</el-button>
              <el-button icon="el-icon-refresh">重置</el-button>
            </el-form-item>
          </el-form>
        </el-header>
        <el-main>
          <el-row style="float: left; margin-bottom: 10px;">
            <el-button icon="el-icon-plus" size="mini" type="primary">新增</el-button>
            <el-button icon="el-icon-edit" size="mini" type="primary">修改</el-button>
            <el-button icon="el-icon-delete" size="mini" type="danger">删除</el-button>
            <el-button icon="el-icon-download" size="mini" type="warning">导出</el-button>
          </el-row>
          <el-table :cell-style="{ textAlign: 'center' }" :data="tableData"
            :header-cell-style="{ backgroundColor: '#f7f8fa', textAlign: 'center' }" size="mini">
            <el-table-column type="selection" />
            <el-table-column label="用户编码" prop="code" />
            <el-table-column label="用户名称" prop="name" />
            <el-table-column label="用户昵称" prop="num" />
            <el-table-column label="部门" prop="depart" />
            <el-table-column label="手机号" prop="phone" />
            <el-table-column label="状态" prop="status">
              <template slot-scope="scope">
                <el-switch active-color="#13ce66" v-model="scope.row.status" />
              </template>
            </el-table-column>
            <el-table-column label="创建时间" prop="createDate" />
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button icon="el-icon-edit" title="编辑" type="text"></el-button>
                <el-button icon="el-icon-circle-plus-outline" title="新增" type="text"></el-button>
                <el-button icon="el-icon-delete" style="color: red" title="删除" type="text"></el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination :total="tableData.length" layout="total, sizes, prev, pager, next, jumper" />
        </el-main>
      </el-col>
    </el-row>
  </el-container>
</template>

<script>
import Pagination from '../../components/Pagination'
export default {
  components: {
  },
  data() {
    return {
      tableData: [
        { code: '3435', createDate: '2022-07-27', name: '纪广', num: 'socal', depart: '研发部门', phone: '19333312231', order: 1, status: true },
        { code: '9582', createDate: '2022-09-03', name: '张三', num: 'socal', depart: '研发部门', phone: '19113212388', order: 2, status: true },
        { code: '1762', createDate: '2022-12-10', name: '刘大大', num: 'test', depart: '运维部门', phone: '19333312231', order: 3, status: true }
      ],
      treeData: [
        {
        label: '全部',
        children: [{
          label: '二级公司',
          children: [{
            label: '研发部门'
          },{
            label: '测试部门'
          },{
            label: '财务部门'
          },{
            label: '运维部门'
          },{
            label: '人力部门'
          }]
        }]
      }],
      defaultProps: {
        children: 'children',
        label: 'label'
      }
    }
  },
  // 注册组件
  components: {
    Pagination
  },
  created() {
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
/deep/ .el-form-item {
  margin-bottom: 0;
}

.el-breadcrumb {
  margin: 5px;
}

.el-container {
  background-color: #eef3fa;
  height: 100%;
  padding: 10px;
}

.el-form-item--mini.el-form-item {
  margin: 10px;
}

.el-header {
  background-color: white;
  margin: 10px 0;
  padding: 15px 30px;
  min-height: 60px !important;
  height: auto !important;
}

.el-main {
  background-color: white;
}

.el-pagination {
  margin-top: 10px;
  text-align: right;
}

/deep/ .el-main .el-row {
  button:nth-child(2) {
    background-color: rgb(103, 219, 220) !important;
    border: 1px solid rgb(103, 219, 220);
  }
}

/deep/ .el-form--inline {
  display: flex;
  flex-wrap: wrap;
  .el-form-item{
    display: flex;
  }
}

/deep/ .el-col-6 {
  height: 80vh;
  background: #fff;
  margin-top: 10px;
}
</style>

 
 